<template>
  <div id="app">
    <div id="main" v-show="!global.showPageLoading">
      <router-view/>
    </div>
    <div class="pageLoading" v-if="global.showPageLoading">
      <van-loading color="#1989fa" size="40" text-size="14" vertical>加载中...</van-loading>
    </div>
  </div>
</template>

<style lang="scss">
html,body{
  width: 100vw;
  height: 100vh;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  widows: 100%;
  height: 100%;
  #main{
    widows: 100%;
    height: 100%;
  }
  .pageLoading{
    width: 100%;
    z-index: 20;
    padding-top: calc((100% - 70px) / 2);
    background: white;
  }
    
}

$maxWidth: 740px;
@media screen and (min-width: $maxWidth){
  html{
    width: $maxWidth;
    margin: 0px calc((100vw - #{$maxWidth}) / 2);
  }
  body{
    width: $maxWidth;
  }
}

</style>

<script lang="ts">
import { Component, Prop, Vue, Watch, Model } from 'vue-property-decorator';
import store from './store/index';
import {Loading} from 'vant';

Vue.use(Loading);
@Component
export default class AppComponent extends Vue {
  private global: any = {
    showPageLoading: false
  };
  
  async created(){
    this.global=store.getters['global/getGlobal'];
  }

  private onTabbarChange(index){
    console.log(index)
  }
}
</script>>

